All Questions
16 questions
2votes
2answers
520views
Write deduplicated 9-digit numbers from concurrent clients to a log
Problem Statement: Write a server (“Application”) in Java that opens a socket and restricts input to at most 5 concurrent clients. Clients will connect to the Application and write any number of 9 ...
1vote
1answer
1kviews
Concurrent Queue with enqueue and dequeue using Stack as underlying data structure
This is a mix of data structure and multi threading concept based question. (This is only for understanding and learning purpose) The language for the solution : Java A Queue with FIFO behavior needs ...
1vote
1answer
3kviews
Thread Safe Evicting Queue in Java
Just wrote an Evicting Queue implementation, as an ordinary Linked List working under the hood, in Java; which, I hope, I've made thread safe, could you review? Code: ...
2votes
0answers
276views
Throttle submissions to ExecutorService
To prevent an XY problem, I'll first explain the problem I am trying to solve: Problem I am trying to solve I want to send the contents of a MongoDB collection with a size of around 3 million ...
5votes
1answer
2kviews
Message Queue for inter-thread communication
I wrote this little piece of code, a while back. The intention behind it was to create a system to send messages between consumer and producer threads. I have no idea for what i wanted to use it. I ...
1vote
1answer
932views
Job queue with threading
On many articles and blogs, I have read that exceptions should not decide flow of your code. I have wrote the following code using one thread: ...
-2votes
2answers
686views
Simple Implementation of a BlockingQueue
An implementation of BlockingQueue ...
5votes
1answer
144views
MailQueue - follow up
Follow up of this question. Things altered: Put logging (debug level) for creating and starting thread. A separate thread for starting the different threads. Locking object and synchronise for ...
7votes
2answers
1kviews
MailQueue implementation with auto start - stop
Previous question was a little portion of the mailQueue. I finished the MailQueue, which has the ability to start and stop ...
4votes
2answers
2kviews
Using a Java queue
I am developing a plugin for a system, the plugin catches some events in that system, wraps them and pushes out to another system for analysis. The overhead generated by the plugin must be as low as ...
3votes
3answers
109views
Threadsafe get method on queue that draws values from other queues?
I have a class that implements Queue and draws values from other queues which may still be referenced outwith it. I want my method to draw values from the contained queues, using synchronized locks on ...
5votes
5answers
21kviews
Circular queue implementation
I've implemented a simple thread-safe circular queue. I'm looking for code review, optimizations and best practices. ...
5votes
4answers
9kviews
Optimizing a thread safe Java NIO / Serialization / FIFO Queue
I've written a thread safe, persistent FIFO for Serializable items. The reason for reinventing the wheel is that we simply can't afford any third party dependencies ...
4votes
2answers
5kviews
Robust logging solution to file on disk from multiple threads on serverside code
I have implemented a socket listener that runs on my Linux Ubuntu server accepting connections and then starting up a new thread to listen on those connections (classic socket listener approach). ...
15votes
5answers
17kviews